﻿using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Configuration;
using System.Web.Security;

namespace Reece.Open.Mvc
{
    public interface IFormsAuthentication
    {
        string CookieDomain { get; }
        HttpCookieMode CookieMode { get; }
        bool CookiesSupported { get; }
        string DefaultUrl { get; }
        bool EnableCrossAppRedirects { get; }
        string FormsCookieName { get; }
        string FormsCookiePath { get; }
        bool IsEnabled { get; }
        string LoginUrl { get; }
        bool RequireSSL { get; }
        bool SlidingExpiration { get; }
        TicketCompatibilityMode TicketCompatibilityMode { get; }
        TimeSpan Timeout { get; }
        bool Authenticate(string name, string password);
        FormsAuthenticationTicket Decrypt(string encryptedTicket);
        void EnableFormsAuthentication(NameValueCollection configurationData);
        string Encrypt(FormsAuthenticationTicket ticket);
        HttpCookie GetAuthCookie(string userName, bool createPersistentCookie, string strCookiePath);
        HttpCookie GetAuthCookie(string userName, bool createPersistentCookie);
        string GetRedirectUrl(string userName, bool createPersistentCookie);
        string HashPasswordForStoringInConfigFile(string password, string passwordFormat);
        void Initialize();
        void RedirectFromLoginPage(string userName, bool createPersistentCookie, string strCookiePath);
        void RedirectFromLoginPage(string userName, bool createPersistentCookie);
        void RedirectToLoginPage(string extraQueryString);
        void RedirectToLoginPage();
        FormsAuthenticationTicket RenewTicketIfOld(FormsAuthenticationTicket tOld);
        void SetAuthCookie(string userName, bool createPersistentCookie, string strCookiePath);
        void SetAuthCookie(string userName, bool createPersistentCookie);
        void SignOut();
    }
}
